package org.dwpd.utils;

import jakarta.annotation.Resource;
import org.dwpd.service.message.MessageService;
import org.dwpd.service.user.UserService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class TaskUtils {

    @Resource
    private MessageService messageService;

    @Resource
    private UserService userService;

    /**
     * 定时修改超时任务状态 00:00
     */
    @Scheduled(cron = "0 0 0 * * ?")
    public void accomplishAllOverTimeTask() {
        messageService.accomplishAllOverTimeTask();
    }

    /**
     * 定时修改用户等级
     */
    @Scheduled(cron = "0 0 22 ? * SUN")
    public void updateUserLevel() {
        userService.updateUserLevel();
    }
}
